const path = require('path');


function resolve(dir = '') {
  return path.join(__dirname, './src', dir);
}

module.exports = {
 // baseUrl: './',
    publicPath:'./',

    css: {
        // 是否使用css分离插件 ExtractTextPlugin
        extract: true,
        // 开启 CSS source maps?
        sourceMap: false,
        // css预设器配置项
        loaderOptions: {},
        // 启用 CSS modules for all css / pre-processor files.
        modules: false
    },
  devServer: {

        proxy: {
            '/api': {
                target: 'http://localhost:4000',
                ws: false,
                changeOrigin:true,//允许跨域
                pathRewrite: {
                    '^/api': ''
                }
            }
        }

  },
  configureWebpack: {
    resolve: {
      alias: {
        '@': resolve('components'),
        '@CFG': resolve('config.js'),
      }
    }
  }
}
